package antidestiny.utilib;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.support.v7.app.AlertDialog;
import android.util.Log;

/**
 * Created by Hero on 2016/5/1.
 */
public class Aide {
    private static boolean debuggable=false;
    public static void tryDebug(Context c){
        ApplicationInfo info= c.getApplicationInfo();
        debuggable=(info.flags& ApplicationInfo.FLAG_DEBUGGABLE)!=0;
    }
    public static void  t(String s){
      if (debuggable)
            Log.e("临时信息：",s);
    }
    public static void e(String s){
        Log.e("错误信息：",s);
    }
    public static void eDialog(Context c,String s){
        AlertDialog.Builder builder=new AlertDialog.Builder(c);
        builder.setTitle("出错了！").setMessage(s).show();
    }
    public static void w(String s){
        Log.w("警告信息：",s);
    }
    public static boolean debugging(){
        return debuggable;
    }
}
